<html>
<head>
<title> Installing the build environment</title>
</head>
<body>

<h2>Installing the build environment</h2>
<p>If you don't already have it, first download&nbsp;install the<a href="http://arduino.cc/en/Main/Software"> 
Arduino software</a>. You won't be using the Arduino IDE but you will be using 
the libraries and compiler. </p>
<p>Next&nbsp;download and install&nbsp;<a href="http://www.codeblocks.org/downloads/5">Code::Blocks</a>. 
You just need the basic package, you don't need the mingw version.</p>
<p>When you run the installer you wil be presented with a list of components 
to install. Make sure you select 'C::B Share Config'. It is also a good idea 
to select 'Auto versioning plugin' in the 'Contrib plugins' category.</p>
<p><img src="Components.gif" width="503" height="393" border="0" alt="Components.gif"></p>
<p>The rest of the settings you can leave at their defaults. Answer yes when 
it asks if you want to run Code::Blocks.&nbsp;Close the dialogs that appear. 
If you don't already&nbsp;have a C/C++ IDE then you may want to associate c 
and C++ files with Code::Blocks. Close code::blocks (don't save the layout) 
and close the installer if it hasn't closed itself.</p>
<p>Make sure you have no copies of Code::Blocks running and go to the Code::Blocks 
entry in your start menu.Click on 'CB Share Config'. For the source file select 
&nbsp;'CodeblocksArduino.conf' in your&nbsp;FlightOS folder. For the destination 
file just selelect the default file. Click 'Transfer' then 'Save'. Close Share 
Config.</p>
<p>.<img src="CBConfig.gif" width="658" height="480" border="0" alt="CBConfig.gif"></p>
<p>We are nearly there. Click on the FlightOS workspace file in your FlightOS 
directory. Code::Blocks should run. Right click on the 'ArduinoLibs' project 
and select 'Rebuild'. If all goes to plan you should get a bunch of warnings 
(Arduino does some pretty odd things with pointers)&nbsp;but at the end it should 
say something like&nbsp;'Build finished: 0 errors, 37 warnings'.</p>
<p>&nbsp;If it fails to build with a big red error message, it will probably 
be because Code::Blocks can't find your Arduino installation. In that case you&nbsp;have 
to manually set the Arduino path. Go to Settings-&gt;Global variables. For the 
current variable select 'arduino'. In the 'base' box enter the path to your 
Arduino installation. Check the Arduino libs now rebuild correctly.</p>
<p>Now you need to set the Arduino com port. Go to Settings-&gt;Global variables. 
For the current variable select 'arduino'. Set the port to your COM port.</p>
<p>Finally&nbsp;right click on FlightOS and select 'rebuild'. It should build 
and try to upload to your Arduino. For future reference there are tool bar icons 
for build and rebuild. I would recommend using 'rebuild' when you make changes 
instead of 'build'. Build works most of the time but I have had a few cases 
where it fails to compile the latest changes.</p>
<p>I will cover setting up wxWidgets for the config program later.</p>
</body>
</html>